package seclog.sample;

import java.net.Socket;
import java.io.ObjectOutputStream;

import seclog.util.Networking;
import seclog.wireformats.MessageType;

public class ConnectClient {

	public static void main(String[] argv) throws Exception 
	{
		String hostname = "127.0.0.1";
		int port = 5000;
		String type = "HELLO";
		
		MessageType mt = new MessageType(type);
		
		// connect to the remote host
		Socket sock = Networking.openSocket(hostname, port);
		
		ObjectOutputStream oos = new ObjectOutputStream(sock.getOutputStream());
		oos.flush();
		oos.writeObject(mt);

		oos.close();
		sock.close();
	}
}
